Rust is doing wrong calculations